package com.ruoyi.youtobe.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.youtobe.domain.YoutobeChannelVideo;
import com.ruoyi.youtobe.mapper.YoutobeChannelVideoMapper;
import com.ruoyi.youtobe.service.IYoutobeChannelVideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * YouToBe视频信息Service业务层处理
 *
 * @author ruoyi
 * @date 2025-11-15
 */
@Service
public class YoutobeChannelVideoServiceImpl implements IYoutobeChannelVideoService {
    @Autowired
    private YoutobeChannelVideoMapper youtobeChannelVideoMapper;

    /**
     * 查询YouToBe视频信息
     *
     * @param id YouToBe视频信息主键
     * @return YouToBe视频信息
     */
    @Override
    public YoutobeChannelVideo selectYoutobeChannelVideoById(Long id) {
        return youtobeChannelVideoMapper.selectYoutobeChannelVideoById(id);
    }

    /**
     * 查询YouToBe视频信息列表
     *
     * @param youtobeChannelVideo YouToBe视频信息
     * @return YouToBe视频信息
     */
    @Override
    public List<YoutobeChannelVideo> selectYoutobeChannelVideoList(YoutobeChannelVideo youtobeChannelVideo) {
        return youtobeChannelVideoMapper.selectYoutobeChannelVideoList(youtobeChannelVideo);
    }

    /**
     * 新增YouToBe视频信息
     *
     * @param youtobeChannelVideo YouToBe视频信息
     * @return 结果
     */
    @Override
    public int insertYoutobeChannelVideo(YoutobeChannelVideo youtobeChannelVideo) {
        youtobeChannelVideo.setCreateTime(DateUtils.getNowDate());
        return youtobeChannelVideoMapper.insertYoutobeChannelVideo(youtobeChannelVideo);
    }

    /**
     * 修改YouToBe视频信息
     *
     * @param youtobeChannelVideo YouToBe视频信息
     * @return 结果
     */
    @Override
    public int updateYoutobeChannelVideo(YoutobeChannelVideo youtobeChannelVideo) {
        youtobeChannelVideo.setUpdateTime(DateUtils.getNowDate());
        return youtobeChannelVideoMapper.updateYoutobeChannelVideo(youtobeChannelVideo);
    }

    /**
     * 批量删除YouToBe视频信息
     *
     * @param ids 需要删除的YouToBe视频信息主键
     * @return 结果
     */
    @Override
    public int deleteYoutobeChannelVideoByIds(Long[] ids) {
        return youtobeChannelVideoMapper.deleteYoutobeChannelVideoByIds(ids);
    }

    /**
     * 删除YouToBe视频信息信息
     *
     * @param id YouToBe视频信息主键
     * @return 结果
     */
    @Override
    public int deleteYoutobeChannelVideoById(Long id) {
        return youtobeChannelVideoMapper.deleteYoutobeChannelVideoById(id);
    }
}
